from socket import *

udpSocket = socket(AF_INET,SOCK_DGRAM)
    
destIp = input("请输入目的IP: ")
destPort = int(input("请输入目的port: "))
sendData = input("请输入要发送的数据: ")

udpSocket.sendto(sendData.encode("gbk"),(destIp,destPort))

udpSocket.close()